home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 62
/
Volume 62 - JOGO DISK .iso
/
Games
/
penguin_dinner.swf
/
scripts
/
__Packages
/
classes
/
game
/
HeroCommandQueue.as
< prev
next >
Wrap
Text File
|
2008-03-17
|
711b
|
37 lines
class classes.game.HeroCommandQueue
{
var closed = false;
var QUEUED_COMMANDS_MAX = 4;
function HeroCommandQueue()
{
this.commands = [];
}
function enqueue(c)
{
if(this.commands.length > this.QUEUED_COMMANDS_MAX)
{
return undefined;
}
this.commands.unshift(c);
}
function dequeue()
{
if(this.commands.length == 0 || this.closed)
{
return null;
}
this.closed = true;
var _loc2_ = this.commands.pop();
return _loc2_;
}
function clear()
{
this.commands = [];
this.closed = false;
}
function open()
{
this.closed = false;
}
}